package com.lion.seaman.worker.flows;

public class JobTreeItem {
    boolean isRoot;
    String flowId;
    JobFlow jobFlow;
    String parentFlowId;

    public JobTreeItem() {
    }

    public static JobTreeItem create(JobFlow jobFlow, String flowId) {
        return jobFlow.toJobItem(flowId);
    }

    public static JobTreeItem createRoot(JobFlow jobFlow) {
        JobTreeItem item = jobFlow.toJobItem("***ROOT***");
        item.isRoot = true;
        return item;
    }

    public String getFlowId() {
        return flowId;
    }

    public void setFlowId(String flowId) {
        this.flowId = flowId;
    }

    public JobFlow getJobFlow() {
        return jobFlow;
    }

    public void setJobFlow(JobFlow jobFlow) {
        this.jobFlow = jobFlow;
    }

    public String getParentFlowId() {
        return parentFlowId;
    }

    public void setParentFlowId(String parentFlowId) {
        this.parentFlowId = parentFlowId;
    }

    public boolean isRoot() {
        return isRoot;
    }

    public void setRoot(boolean root) {
        isRoot = root;
    }
}
